home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 December / MACPOWER-1997-12.ISO.7z / MACPOWER-1997-12.ISO / AMUG / PROGRAMMING / Raven 1.2 Examples.sit / Raven 1.2 Examples / Skeleton / Source / Window.cpp < prev    next >
Text File  |  1997-09-04  |  3KB  |  123 lines

  1. /*
  2.  *  File:       Window.cpp
  3.  *  Summary:       A window into the document's data.
  4.  *  Written by: Jesse Jones
  5.  *
  6.  *  Copyright ゥ 1996 Jesse Jones. 
  7.  *    For conditions of distribution and use, see copyright notice in ZTypes.h  
  8.  *
  9.  *  Change History (most recent first):    
  10.  *
  11.  *         <->     5/26/96    JDJ        Created
  12.  */
  13.  
  14. #include "Window.h"
  15.  
  16. #include <ZEvent.h>
  17. #include <ZStream.h>
  18.  
  19. #include "Doc.h"
  20.  
  21.  
  22. //-----------------------------------
  23. //    Constants
  24. //
  25. const short kSavedVersion = 0;                    // Version number of the saved data
  26.  
  27.  
  28. // ===================================================================================
  29. //    class CWindow
  30. // ===================================================================================
  31.  
  32. // Registers CWindow::Create with the reanimator so that the window
  33. // can be reanimated from a 'Wind' resource. Note that the "Dead
  34. // Strip Static Initialization Code" linker preference should be off.
  35. static TReanimatorRegister<CWindow> sMyWindowRegistrar;
  36.  
  37. //---------------------------------------------------------------
  38. //
  39. // CWindow::~CWindow
  40. //
  41. //---------------------------------------------------------------
  42. CWindow::~CWindow()
  43. {
  44. }
  45.  
  46.  
  47. //---------------------------------------------------------------
  48. //
  49. // CWindow::CWindow 
  50. //
  51. //---------------------------------------------------------------
  52. CWindow::CWindow()
  53. {
  54. }
  55.  
  56.  
  57. //---------------------------------------------------------------
  58. //
  59. // CWindow::OnReanimated 
  60. //
  61. //---------------------------------------------------------------
  62. void CWindow::OnReanimated()
  63. {    
  64.     Inherited::OnReanimated();
  65.     
  66.     // At this point the view hierarchy is complete so you can use
  67.     // FindPane() to get references to child panes.
  68. }
  69.  
  70.  
  71. //---------------------------------------------------------------
  72. //
  73. // CWindow::Create                                        [static]
  74. //
  75. //---------------------------------------------------------------
  76. MReanimatable* CWindow::Create(MReanimatable* parent)
  77. {
  78.     #pragma unused(parent)
  79.     
  80.     // When creating views parent is the superView. When creating
  81.     // windows parent should be nil. (TWindow::Create takes care
  82.     // of setting the window's superCommander).
  83.     ASSERT(parent == nil);
  84.     
  85.     return new CWindow;
  86. }
  87.  
  88. #pragma mark ハ
  89.  
  90. //---------------------------------------------------------------
  91. //
  92. // CWindow::OnMenuCommand
  93. //
  94. //---------------------------------------------------------------
  95. bool CWindow::OnMenuCommand(const MenuCommand& command)
  96. {
  97.     bool handled = false;
  98.     
  99.     if (!handled)
  100.         handled = Inherited::OnMenuCommand(command);
  101.     
  102.     return handled;
  103. }
  104.  
  105.  
  106. //---------------------------------------------------------------
  107. //
  108. // CWindow::OnCommandStatus
  109. //
  110. //---------------------------------------------------------------
  111. bool CWindow::OnCommandStatus(const MenuCommand& command, SCommandStatus& status)
  112. {
  113.     bool handled = false;
  114.     
  115.     if (!handled)
  116.         handled = Inherited::OnCommandStatus(command, status);
  117.     
  118.     return handled;
  119. }
  120.  
  121.  
  122.  
  123.